package cn.fintecher.pangolin.service.manage.web;

import cn.fintecher.pangolin.common.web.BaseController;
import cn.fintecher.pangolin.entity.mysql.Resource;
import cn.fintecher.pangolin.service.manage.service.ResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: xiaqun
 * @Description: 资源相关接口
 * @Date: 17:32 2019/8/16
 */

@RestController
@RequestMapping("/api/resourceController")
@Api(value = "资源相关接口", description = "资源相关接口")
public class ResourceController extends BaseController {
    @Autowired
    private ResourceService resourceService;

    /**
     * 查询全部资源
     */
    @ApiOperation(value = "查询全部资源", notes = "查询全部资源")
    @GetMapping("/findAllResource")
    public ResponseEntity<List<Resource>> findAllResource() {
        log.info("REST request to find all resource");
        List<Resource> list = resourceService.findAllResource();
        return ResponseEntity.ok().body(list);
    }
}
